<template>
  <el-dialog :visible.sync="isShow" width="800px" :title='title' append-to-body>
    <el-descriptions class="margin-top" :column="3" border>
      <el-descriptions-item label="名称" :labelStyle="{width: '100px'}">{{ rowData.name }}</el-descriptions-item>
      <el-descriptions-item label="长文本" :labelStyle="{width: '100px'}">{{ rowData.longText }}</el-descriptions-item>
      <el-descriptions-item label="是否显示" :labelStyle="{width: '100px'}">{{ rowData.isShow?'是':'否' }}</el-descriptions-item>
      <el-descriptions-item label="状态" :labelStyle="{width: '100px'}">{{ rowData.statusLabel }}</el-descriptions-item>
      <el-descriptions-item label="排序" :labelStyle="{width: '100px'}">{{ rowData.sort }}</el-descriptions-item>
      <el-descriptions-item label="开始时间" :labelStyle="{width: '100px'}">{{ formatTime.dateFormat('YY-MM-DD hh:mm:ss', rowData.startTime) }}</el-descriptions-item>
    </el-descriptions>
  </el-dialog>
</template>

<script>
import { getLearnById } from '@/api/system/learn.js'

export default {
  components: {
  },
  props: {
  },
  data() {
    return {
      isShow: false,
      rowId: '',
      rowData: {},
      title: ''

    }
  },
  created() {

  },
  methods: {
    show(val) {
      this.isShow = true
      if (val.rowId) {
        this.rowId = val.rowId
        this.title = val.title
        this.getItemInfo()
      }
    },
    close() {
      this.isShow = false
    },
    getItemInfo() {
      getLearnById({
        obj_id: this.rowId
      }).then(res => {
        if (res.data.code == 10000) {
          this.rowData = res.data.data
        }
      });
    },
  }
}
</script>

<style lang="scss" scoped></style>